{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Classifying IMDB movie reviews"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import turicreate as tc\n",
    "import utils"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre>Finished parsing file /Users/luisserrano/Documents/Book/code/manning/Chapter 6 - Logistic Regression/IMDB Dataset.csv</pre>"
      ],
      "text/plain": [
       "Finished parsing file /Users/luisserrano/Documents/Book/code/manning/Chapter 6 - Logistic Regression/IMDB Dataset.csv"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Parsing completed. Parsed 100 lines in 0.755906 secs.</pre>"
      ],
      "text/plain": [
       "Parsing completed. Parsed 100 lines in 0.755906 secs."
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "------------------------------------------------------\n",
      "Inferred types from first 100 line(s) of file as \n",
      "column_type_hints=[str,str]\n",
      "If parsing fails due to incorrect types, you can correct\n",
      "the inferred type list above and pass it to read_csv in\n",
      "the column_type_hints argument\n",
      "------------------------------------------------------\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre>Read 39624 lines. Lines per second: 37039.5</pre>"
      ],
      "text/plain": [
       "Read 39624 lines. Lines per second: 37039.5"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Finished parsing file /Users/luisserrano/Documents/Book/code/manning/Chapter 6 - Logistic Regression/IMDB Dataset.csv</pre>"
      ],
      "text/plain": [
       "Finished parsing file /Users/luisserrano/Documents/Book/code/manning/Chapter 6 - Logistic Regression/IMDB Dataset.csv"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Parsing completed. Parsed 50000 lines in 1.24294 secs.</pre>"
      ],
      "text/plain": [
       "Parsing completed. Parsed 50000 lines in 1.24294 secs."
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">review</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">sentiment</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">One of the other<br>reviewers has mentioned ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">A wonderful little<br>production. &lt;br /&gt;&lt;br ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I thought this was a<br>wonderful way to spend ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Basically there&#x27;s a<br>family where a little ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">negative</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Petter Mattei&#x27;s &quot;Love in<br>the Time of Money&quot; is a ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Probably my all-time<br>favorite movie, a story ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I sure would like to see<br>a resurrection of a up ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">This show was an amazing,<br>fresh &amp; innovative idea ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">negative</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Encouraged by the<br>positive comments about ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">negative</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">If you like original gut<br>wrenching laughter you ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[50000 rows x 2 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\treview\tstr\n",
       "\tsentiment\tstr\n",
       "\n",
       "Rows: 50000\n",
       "\n",
       "Data:\n",
       "+-------------------------------+-----------+\n",
       "|             review            | sentiment |\n",
       "+-------------------------------+-----------+\n",
       "| One of the other reviewers... |  positive |\n",
       "| A wonderful little product... |  positive |\n",
       "| I thought this was a wonde... |  positive |\n",
       "| Basically there's a family... |  negative |\n",
       "| Petter Mattei's \"Love in t... |  positive |\n",
       "| Probably my all-time favor... |  positive |\n",
       "| I sure would like to see a... |  positive |\n",
       "| This show was an amazing, ... |  negative |\n",
       "| Encouraged by the positive... |  negative |\n",
       "| If you like original gut w... |  positive |\n",
       "+-------------------------------+-----------+\n",
       "[50000 rows x 2 columns]\n",
       "Note: Only the head of the SFrame is printed.\n",
       "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movies = tc.SFrame('./IMDB_Dataset.csv')\n",
    "movies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">review</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">sentiment</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">words</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">One of the other<br>reviewers has mentioned ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;if&#x27;: 1.0, &#x27;viewing&#x27;:<br>1.0, &#x27;comfortable&#x27;: 1.0, ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">A wonderful little<br>production. &lt;br /&gt;&lt;br ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;done&#x27;: 1.0, &#x27;every&#x27;:<br>1.0, &#x27;decorating&#x27;: 1.0, ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I thought this was a<br>wonderful way to spend ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;see&#x27;: 1.0, &#x27;go&#x27;: 1.0,<br>&#x27;great&#x27;: 1.0, &#x27;superm ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Basically there&#x27;s a<br>family where a little ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">negative</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;them&#x27;: 1.0, &#x27;ignore&#x27;:<br>1.0, &#x27;dialogs&#x27;: 1.0, ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Petter Mattei&#x27;s &quot;Love in<br>the Time of Money&quot; is a ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;work&#x27;: 1.0, &#x27;his&#x27;: 1.0,<br>&#x27;for&#x27;: 1.0, &#x27;anxiously&#x27;: ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Probably my all-time<br>favorite movie, a story ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;for&#x27;: 1.0, &#x27;dozen&#x27;:<br>1.0, &#x27;i&#x27;: 1.0, &#x27;if&#x27;:  ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I sure would like to see<br>a resurrection of a up ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;do&#x27;: 1.0, &#x27;lets&#x27;: 1.0,<br>&#x27;go&#x27;: 1.0, &#x27;movies&#x27;:  ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">This show was an amazing,<br>fresh &amp; innovative idea ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">negative</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;awful&#x27;: 1.0, &#x27;just&#x27;:<br>1.0, &#x27;huge&#x27;: 1.0, &#x27;a&#x27;: ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Encouraged by the<br>positive comments about ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">negative</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;effort&#x27;: 1.0, &#x27;an&#x27;:<br>1.0, &#x27;making&#x27;: 1.0, ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">If you like original gut<br>wrenching laughter you ...</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">{&#x27;camp&#x27;: 1.0, &#x27;great&#x27;:<br>1.0, &#x27;br&#x27;: 2.0, &#x27;mom&#x27;: ...</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[50000 rows x 3 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\treview\tstr\n",
       "\tsentiment\tstr\n",
       "\twords\tdict\n",
       "\n",
       "Rows: 50000\n",
       "\n",
       "Data:\n",
       "+-------------------------------+-----------+-------------------------------+\n",
       "|             review            | sentiment |             words             |\n",
       "+-------------------------------+-----------+-------------------------------+\n",
       "| One of the other reviewers... |  positive | {'if': 1.0, 'viewing': 1.0... |\n",
       "| A wonderful little product... |  positive | {'done': 1.0, 'every': 1.0... |\n",
       "| I thought this was a wonde... |  positive | {'see': 1.0, 'go': 1.0, 'g... |\n",
       "| Basically there's a family... |  negative | {'them': 1.0, 'ignore': 1.... |\n",
       "| Petter Mattei's \"Love in t... |  positive | {'work': 1.0, 'his': 1.0, ... |\n",
       "| Probably my all-time favor... |  positive | {'for': 1.0, 'dozen': 1.0,... |\n",
       "| I sure would like to see a... |  positive | {'do': 1.0, 'lets': 1.0, '... |\n",
       "| This show was an amazing, ... |  negative | {'awful': 1.0, 'just': 1.0... |\n",
       "| Encouraged by the positive... |  negative | {'effort': 1.0, 'an': 1.0,... |\n",
       "| If you like original gut w... |  positive | {'camp': 1.0, 'great': 1.0... |\n",
       "+-------------------------------+-----------+-------------------------------+\n",
       "[50000 rows x 3 columns]\n",
       "Note: Only the head of the SFrame is printed.\n",
       "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movies['words'] = tc.text_analytics.count_words(movies['review'])\n",
    "movies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "PROGRESS: Creating a validation set from 5 percent of training data. This may take a while.\n",
      "          You can set ``validation_set=None`` to disable validation tracking.\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre>Logistic regression:</pre>"
      ],
      "text/plain": [
       "Logistic regression:"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>--------------------------------------------------------</pre>"
      ],
      "text/plain": [
       "--------------------------------------------------------"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Number of examples          : 47500</pre>"
      ],
      "text/plain": [
       "Number of examples          : 47500"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Number of classes           : 2</pre>"
      ],
      "text/plain": [
       "Number of classes           : 2"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Number of feature columns   : 1</pre>"
      ],
      "text/plain": [
       "Number of feature columns   : 1"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Number of unpacked features : 101655</pre>"
      ],
      "text/plain": [
       "Number of unpacked features : 101655"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Number of coefficients      : 101656</pre>"
      ],
      "text/plain": [
       "Number of coefficients      : 101656"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>Starting L-BFGS</pre>"
      ],
      "text/plain": [
       "Starting L-BFGS"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>--------------------------------------------------------</pre>"
      ],
      "text/plain": [
       "--------------------------------------------------------"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>+-----------+----------+-----------+--------------+-------------------+---------------------+</pre>"
      ],
      "text/plain": [
       "+-----------+----------+-----------+--------------+-------------------+---------------------+"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>| Iteration | Passes   | Step size | Elapsed Time | Training Accuracy | Validation Accuracy |</pre>"
      ],
      "text/plain": [
       "| Iteration | Passes   | Step size | Elapsed Time | Training Accuracy | Validation Accuracy |"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>+-----------+----------+-----------+--------------+-------------------+---------------------+</pre>"
      ],
      "text/plain": [
       "+-----------+----------+-----------+--------------+-------------------+---------------------+"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>| 0         | 2        | 1.000000  | 1.494704     | 0.919747          | 0.855600            |</pre>"
      ],
      "text/plain": [
       "| 0         | 2        | 1.000000  | 1.494704     | 0.919747          | 0.855600            |"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>| 1         | 4        | 1.000000  | 2.085863     | 0.961305          | 0.880000            |</pre>"
      ],
      "text/plain": [
       "| 1         | 4        | 1.000000  | 2.085863     | 0.961305          | 0.880000            |"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>| 2         | 5        | 1.000000  | 2.452073     | 0.978611          | 0.893200            |</pre>"
      ],
      "text/plain": [
       "| 2         | 5        | 1.000000  | 2.452073     | 0.978611          | 0.893200            |"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>| 3         | 7        | 1.000000  | 3.015716     | 0.982779          | 0.898000            |</pre>"
      ],
      "text/plain": [
       "| 3         | 7        | 1.000000  | 3.015716     | 0.982779          | 0.898000            |"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>| 4         | 8        | 1.000000  | 3.400111     | 0.988021          | 0.902400            |</pre>"
      ],
      "text/plain": [
       "| 4         | 8        | 1.000000  | 3.400111     | 0.988021          | 0.902400            |"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>| 9         | 13       | 1.000000  | 5.560842     | 0.999453          | 0.876400            |</pre>"
      ],
      "text/plain": [
       "| 9         | 13       | 1.000000  | 5.560842     | 0.999453          | 0.876400            |"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre>+-----------+----------+-----------+--------------+-------------------+---------------------+</pre>"
      ],
      "text/plain": [
       "+-----------+----------+-----------+--------------+-------------------+---------------------+"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = tc.logistic_classifier.create(movies, features=['words'], target='sentiment')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Class                          : LogisticClassifier\n",
       "\n",
       "Schema\n",
       "------\n",
       "Number of coefficients         : 101656\n",
       "Number of examples             : 47500\n",
       "Number of classes              : 2\n",
       "Number of feature columns      : 1\n",
       "Number of unpacked features    : 101655\n",
       "\n",
       "Hyperparameters\n",
       "---------------\n",
       "L1 penalty                     : 0.0\n",
       "L2 penalty                     : 0.01\n",
       "\n",
       "Training Summary\n",
       "----------------\n",
       "Solver                         : lbfgs\n",
       "Solver iterations              : 10\n",
       "Solver status                  : Completed (Iteration limit reached).\n",
       "Training time (sec)            : 3.1407\n",
       "\n",
       "Settings\n",
       "--------\n",
       "Log-likelihood                 : 374.1102\n",
       "\n",
       "Highest Positive Coefficients\n",
       "-----------------------------\n",
       "words[midichlorians]           : 22.2978\n",
       "words[nighteyes]               : 21.2877\n",
       "words[whirry]                  : 21.2877\n",
       "words[8bit]                    : 19.9989\n",
       "words[videozone]               : 19.8255\n",
       "\n",
       "Lowest Negative Coefficients\n",
       "----------------------------\n",
       "words[newlwed]                 : -18.009\n",
       "words[sierre]                  : -17.6438\n",
       "words[unfortuntately]          : -17.123\n",
       "words[toyshop]                 : -16.0545\n",
       "words[bsed]                    : -15.2391"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">name</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">index</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">class</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">value</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">stderr</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">(intercept)</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">0.06841566205877811</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">if</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-0.023487063039285324</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">viewing</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">0.16124947220364833</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">comfortable</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">0.5654439707483887</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">become</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">0.12089471177392803</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">may</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">0.16770006937309084</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">skills</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-0.4011207964029393</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">lack</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-0.42365012385990636</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">their</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">0.008015650441388742</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">class</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-0.06077613785804</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[101656 rows x 5 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\tname\tstr\n",
       "\tindex\tstr\n",
       "\tclass\tstr\n",
       "\tvalue\tfloat\n",
       "\tstderr\tfloat\n",
       "\n",
       "Rows: 101656\n",
       "\n",
       "Data:\n",
       "+-------------+-------------+----------+-----------------------+--------+\n",
       "|     name    |    index    |  class   |         value         | stderr |\n",
       "+-------------+-------------+----------+-----------------------+--------+\n",
       "| (intercept) |     None    | positive |  0.06841566205877811  |  None  |\n",
       "|    words    |      if     | positive | -0.023487063039285324 |  None  |\n",
       "|    words    |   viewing   | positive |  0.16124947220364833  |  None  |\n",
       "|    words    | comfortable | positive |   0.5654439707483887  |  None  |\n",
       "|    words    |    become   | positive |  0.12089471177392803  |  None  |\n",
       "|    words    |     may     | positive |  0.16770006937309084  |  None  |\n",
       "|    words    |    skills   | positive |  -0.4011207964029393  |  None  |\n",
       "|    words    |     lack    | positive |  -0.42365012385990636 |  None  |\n",
       "|    words    |    their    | positive |  0.008015650441388742 |  None  |\n",
       "|    words    |    class    | positive |   -0.06077613785804   |  None  |\n",
       "+-------------+-------------+----------+-----------------------+--------+\n",
       "[101656 rows x 5 columns]\n",
       "Note: Only the head of the SFrame is printed.\n",
       "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights = model.coefficients\n",
    "weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">name</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">index</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">class</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">value</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">stderr</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">newlwed</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-18.008960203460823</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">sierre</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-17.643778002004012</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">unfortuntately</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-17.12296496134024</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">toyshop</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-16.054498069060507</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">bsed</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-15.239138446768948</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">lodz</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-15.029381423751193</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">graziano</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-14.766242419647488</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">infirmities</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-14.765733970935916</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">taylors</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-14.272434157625183</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">ruhle</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-14.206555935398512</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[101656 rows x 5 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\tname\tstr\n",
       "\tindex\tstr\n",
       "\tclass\tstr\n",
       "\tvalue\tfloat\n",
       "\tstderr\tfloat\n",
       "\n",
       "Rows: 101656\n",
       "\n",
       "Data:\n",
       "+-------+----------------+----------+---------------------+--------+\n",
       "|  name |     index      |  class   |        value        | stderr |\n",
       "+-------+----------------+----------+---------------------+--------+\n",
       "| words |    newlwed     | positive | -18.008960203460823 |  None  |\n",
       "| words |     sierre     | positive | -17.643778002004012 |  None  |\n",
       "| words | unfortuntately | positive |  -17.12296496134024 |  None  |\n",
       "| words |    toyshop     | positive | -16.054498069060507 |  None  |\n",
       "| words |      bsed      | positive | -15.239138446768948 |  None  |\n",
       "| words |      lodz      | positive | -15.029381423751193 |  None  |\n",
       "| words |    graziano    | positive | -14.766242419647488 |  None  |\n",
       "| words |  infirmities   | positive | -14.765733970935916 |  None  |\n",
       "| words |    taylors     | positive | -14.272434157625183 |  None  |\n",
       "| words |     ruhle      | positive | -14.206555935398512 |  None  |\n",
       "+-------+----------------+----------+---------------------+--------+\n",
       "[101656 rows x 5 columns]\n",
       "Note: Only the head of the SFrame is printed.\n",
       "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights.sort('value')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">name</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">index</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">class</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">value</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">stderr</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">midichlorians</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">22.29776983281403</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">nighteyes</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">21.287690860097893</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">whirry</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">21.287690860097893</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">8bit</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">19.998927723414244</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">videozone</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">19.825507508362612</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">hrm</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">19.55156183659826</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">tensionate</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">18.942245937977955</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">scribble</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">17.774387325839538</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">anansie</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">17.55684264349084</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">scenerios</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">17.546873914743603</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[101656 rows x 5 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\tname\tstr\n",
       "\tindex\tstr\n",
       "\tclass\tstr\n",
       "\tvalue\tfloat\n",
       "\tstderr\tfloat\n",
       "\n",
       "Rows: 101656\n",
       "\n",
       "Data:\n",
       "+-------+---------------+----------+--------------------+--------+\n",
       "|  name |     index     |  class   |       value        | stderr |\n",
       "+-------+---------------+----------+--------------------+--------+\n",
       "| words | midichlorians | positive | 22.29776983281403  |  None  |\n",
       "| words |   nighteyes   | positive | 21.287690860097893 |  None  |\n",
       "| words |     whirry    | positive | 21.287690860097893 |  None  |\n",
       "| words |      8bit     | positive | 19.998927723414244 |  None  |\n",
       "| words |   videozone   | positive | 19.825507508362612 |  None  |\n",
       "| words |      hrm      | positive | 19.55156183659826  |  None  |\n",
       "| words |   tensionate  | positive | 18.942245937977955 |  None  |\n",
       "| words |    scribble   | positive | 17.774387325839538 |  None  |\n",
       "| words |    anansie    | positive | 17.55684264349084  |  None  |\n",
       "| words |   scenerios   | positive | 17.546873914743603 |  None  |\n",
       "+-------+---------------+----------+--------------------+--------+\n",
       "[101656 rows x 5 columns]\n",
       "Note: Only the head of the SFrame is printed.\n",
       "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights.sort('value', ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">name</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">index</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">class</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">value</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">stderr</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">wonderful</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1.062507005990737</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[? rows x 5 columns]<br/>Note: Only the head of the SFrame is printed. This SFrame is lazily evaluated.<br/>You can use sf.materialize() to force materialization.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\tname\tstr\n",
       "\tindex\tstr\n",
       "\tclass\tstr\n",
       "\tvalue\tfloat\n",
       "\tstderr\tfloat\n",
       "\n",
       "Rows: Unknown\n",
       "\n",
       "Data:\n",
       "+-------+-----------+----------+-------------------+--------+\n",
       "|  name |   index   |  class   |       value       | stderr |\n",
       "+-------+-----------+----------+-------------------+--------+\n",
       "| words | wonderful | positive | 1.062507005990737 |  None  |\n",
       "+-------+-----------+----------+-------------------+--------+\n",
       "[? rows x 5 columns]\n",
       "Note: Only the head of the SFrame is printed. This SFrame is lazily evaluated.\n",
       "You can use sf.materialize() to force materialization."
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights[weights['index']=='wonderful']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">name</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">index</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">class</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">value</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">stderr</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">horrible</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">-1.0873352069705353</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[? rows x 5 columns]<br/>Note: Only the head of the SFrame is printed. This SFrame is lazily evaluated.<br/>You can use sf.materialize() to force materialization.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\tname\tstr\n",
       "\tindex\tstr\n",
       "\tclass\tstr\n",
       "\tvalue\tfloat\n",
       "\tstderr\tfloat\n",
       "\n",
       "Rows: Unknown\n",
       "\n",
       "Data:\n",
       "+-------+----------+----------+---------------------+--------+\n",
       "|  name |  index   |  class   |        value        | stderr |\n",
       "+-------+----------+----------+---------------------+--------+\n",
       "| words | horrible | positive | -1.0873352069705353 |  None  |\n",
       "+-------+----------+----------+---------------------+--------+\n",
       "[? rows x 5 columns]\n",
       "Note: Only the head of the SFrame is printed. This SFrame is lazily evaluated.\n",
       "You can use sf.materialize() to force materialization."
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights[weights['index']=='horrible']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
       "    <tr>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">name</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">index</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">class</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">value</th>\n",
       "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">stderr</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">words</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">the</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">positive</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">0.0005341182880871852</td>\n",
       "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">None</td>\n",
       "    </tr>\n",
       "</table>\n",
       "[? rows x 5 columns]<br/>Note: Only the head of the SFrame is printed. This SFrame is lazily evaluated.<br/>You can use sf.materialize() to force materialization.\n",
       "</div>"
      ],
      "text/plain": [
       "Columns:\n",
       "\tname\tstr\n",
       "\tindex\tstr\n",
       "\tclass\tstr\n",
       "\tvalue\tfloat\n",
       "\tstderr\tfloat\n",
       "\n",
       "Rows: Unknown\n",
       "\n",
       "Data:\n",
       "+-------+-------+----------+-----------------------+--------+\n",
       "|  name | index |  class   |         value         | stderr |\n",
       "+-------+-------+----------+-----------------------+--------+\n",
       "| words |  the  | positive | 0.0005341182880871852 |  None  |\n",
       "+-------+-------+----------+-----------------------+--------+\n",
       "[? rows x 5 columns]\n",
       "Note: Only the head of the SFrame is printed. This SFrame is lazily evaluated.\n",
       "You can use sf.materialize() to force materialization."
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights[weights['index']=='the']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "movies['predictions'] = model.predict(movies, output_type='probability')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'review': 'It seems to me that a lot of people don\\'t know that Blade is actually a superhero movie on par with X-Men, Daredevil, Punisher and the likes. What all these heroes (and in the case of X-Men hero group) have in common is that they were all conceived in the magical world of Marvel. Blade was originally a normal person (in a blue outfit) who chased vampires because of a personal grudge and eventually facing of with Dracula himself and he was for lack of a better word boring. So boring in fact that the character was shelved and in fact never used in the Marvel universe. At least until he was reinvented.<br /><br />David Goyer did a stroke of genius when he took the character of Blade and turned him into a leather clad dark knight. He can\\'t take all the credit though and much of this must go to Stephen Norrington as well who with his distinct visual style brings out the best of the character. The Blade character (Wesley Snipes) is pretty amazing in this film and mixes martial arts with Batman like darkness. Snipes is pretty good as the title character and is successful in bringing out the duality and inner demons of the character. He is, however, a pretty rigid actor both in voice and in posture and is only interesting enough for one film (which is clearly seen from the inferior sequels). Kris Kristofferson is good as well and really brings the tormented character of Whistler to life with energy and sense of timing. N\\'Bushe Wright, however, is fairly weak as a leading lady making her character relatively flat and lifeless. Donal Logue is pretty funny and manages to do a lot with a minor character. German, Udo Kier, should also be mentioned as he brings a lot of finesse and style to the vampire race, probably born of his experiences from playing Dracula. Stephen Dorf provides the best acting in the film and his chilling performance as Deacon Frost stands as one of the best screen villains I have perhaps ever seen.<br /><br />The story is good and, I feel, renews the vampire genre (something that hasn\\'t been done since Robert Rodrigues\\' From Dusk Till Dawn) by adding a lot of contemporary elements and maintaining the comic book feel. By saying that the film has a comic book feel does not mean that the film is unrealistic. Far from it. A lot of effort has been put in trying to make the film seem as real as possible. Including the effects which are pretty good for their time. I found the vampire \"dustings\" to be a very nice touch. In stead of adding a lot of blood when a vampire dies Norrington chose to let the vampires spontaneously com-bust which looks great. The fact that the overall effects were well done adds to the credibility of the film which would otherwise have fallen flat on its face.<br /><br />As previously stated Norrington has a very distinct visual style that sets him apart from the directors of the following Blade movies. Del Toro is nearly as skilled but I prefer Norrington\\'s style. His style gives the film a very special look and feel but most importantly it gives the film atmosphere. A very tense dark atmosphere which works great in tune with the main character and story. Along with the visual style the music which also works fine and adds a lot to the atmosphere of the movie.<br /><br />All in all Blade is a very entertaining movie that should probably have had an 8 from me but a few annoying flaws (which cannot be revealed without spoiling the movie, suffice to say, many of them are located near the ending of the film) does that the film must settle with a high 7.<br /><br />7/10',\n",
       " 'sentiment': 'positive',\n",
       " 'words': {'7': 2.0,\n",
       "  'many': 1.0,\n",
       "  'spoiling': 1.0,\n",
       "  'without': 1.0,\n",
       "  'revealed': 1.0,\n",
       "  'annoying': 1.0,\n",
       "  'few': 1.0,\n",
       "  'an': 1.0,\n",
       "  'had': 1.0,\n",
       "  'fine': 1.0,\n",
       "  'music': 1.0,\n",
       "  'along': 1.0,\n",
       "  'main': 1.0,\n",
       "  'importantly': 1.0,\n",
       "  'settle': 1.0,\n",
       "  'most': 1.0,\n",
       "  's': 1.0,\n",
       "  'prefer': 1.0,\n",
       "  'say': 1.0,\n",
       "  'but': 3.0,\n",
       "  'del': 1.0,\n",
       "  'directors': 1.0,\n",
       "  'apart': 1.0,\n",
       "  'sets': 1.0,\n",
       "  'fallen': 1.0,\n",
       "  'otherwise': 1.0,\n",
       "  'its': 1.0,\n",
       "  'great': 2.0,\n",
       "  'looks': 1.0,\n",
       "  'com': 1.0,\n",
       "  'spontaneously': 1.0,\n",
       "  'let': 1.0,\n",
       "  'chose': 1.0,\n",
       "  'dies': 1.0,\n",
       "  'nice': 1.0,\n",
       "  'very': 5.0,\n",
       "  'dustings': 1.0,\n",
       "  'found': 1.0,\n",
       "  'time': 1.0,\n",
       "  'their': 1.0,\n",
       "  'possible': 1.0,\n",
       "  'make': 1.0,\n",
       "  'including': 1.0,\n",
       "  'trying': 1.0,\n",
       "  'effort': 1.0,\n",
       "  'entertaining': 1.0,\n",
       "  'mean': 1.0,\n",
       "  'saying': 1.0,\n",
       "  'book': 2.0,\n",
       "  'maintaining': 1.0,\n",
       "  'contemporary': 1.0,\n",
       "  'adding': 2.0,\n",
       "  'by': 2.0,\n",
       "  'dawn': 1.0,\n",
       "  'suffice': 1.0,\n",
       "  'following': 1.0,\n",
       "  'till': 1.0,\n",
       "  'rodrigues': 1.0,\n",
       "  'bust': 1.0,\n",
       "  'since': 1.0,\n",
       "  'been': 2.0,\n",
       "  'hasn': 1.0,\n",
       "  'something': 1.0,\n",
       "  'atmosphere': 3.0,\n",
       "  'blood': 1.0,\n",
       "  'genre': 1.0,\n",
       "  'feel': 4.0,\n",
       "  'unrealistic': 1.0,\n",
       "  'story': 2.0,\n",
       "  'villains': 1.0,\n",
       "  'stands': 1.0,\n",
       "  'performance': 1.0,\n",
       "  'word': 1.0,\n",
       "  'playing': 1.0,\n",
       "  'these': 1.0,\n",
       "  'probably': 2.0,\n",
       "  'toro': 1.0,\n",
       "  'the': 45.0,\n",
       "  'visual': 3.0,\n",
       "  'race': 1.0,\n",
       "  'would': 1.0,\n",
       "  'vampire': 4.0,\n",
       "  'finesse': 1.0,\n",
       "  'punisher': 1.0,\n",
       "  'be': 3.0,\n",
       "  'do': 1.0,\n",
       "  'udo': 1.0,\n",
       "  'movies': 1.0,\n",
       "  'manages': 1.0,\n",
       "  'go': 1.0,\n",
       "  'i': 4.0,\n",
       "  'likes': 1.0,\n",
       "  'he': 6.0,\n",
       "  'when': 2.0,\n",
       "  'logue': 1.0,\n",
       "  'stead': 1.0,\n",
       "  'lifeless': 1.0,\n",
       "  'universe': 1.0,\n",
       "  'relatively': 1.0,\n",
       "  'demons': 1.0,\n",
       "  'her': 1.0,\n",
       "  'lady': 1.0,\n",
       "  'stroke': 1.0,\n",
       "  'leading': 1.0,\n",
       "  'knight': 1.0,\n",
       "  'energy': 1.0,\n",
       "  'stated': 1.0,\n",
       "  'common': 1.0,\n",
       "  'amazing': 1.0,\n",
       "  'life': 1.0,\n",
       "  'located': 1.0,\n",
       "  'robert': 1.0,\n",
       "  'tormented': 1.0,\n",
       "  'kristofferson': 1.0,\n",
       "  'provides': 1.0,\n",
       "  'for': 3.0,\n",
       "  'lack': 1.0,\n",
       "  'kris': 1.0,\n",
       "  'fairly': 1.0,\n",
       "  'sequels': 1.0,\n",
       "  'inferior': 1.0,\n",
       "  'wright': 1.0,\n",
       "  'clearly': 1.0,\n",
       "  'voice': 1.0,\n",
       "  'interesting': 1.0,\n",
       "  'acting': 1.0,\n",
       "  'only': 1.0,\n",
       "  'both': 1.0,\n",
       "  'far': 1.0,\n",
       "  'men': 2.0,\n",
       "  'inner': 1.0,\n",
       "  'put': 1.0,\n",
       "  'duality': 1.0,\n",
       "  'cannot': 1.0,\n",
       "  'experiences': 1.0,\n",
       "  'face': 1.0,\n",
       "  'a': 26.0,\n",
       "  'successful': 1.0,\n",
       "  'chilling': 1.0,\n",
       "  'elements': 1.0,\n",
       "  'timing': 1.0,\n",
       "  'actor': 1.0,\n",
       "  'good': 4.0,\n",
       "  'should': 2.0,\n",
       "  'donal': 1.0,\n",
       "  'distinct': 2.0,\n",
       "  'mixes': 1.0,\n",
       "  'film': 11.0,\n",
       "  'until': 1.0,\n",
       "  'posture': 1.0,\n",
       "  'pretty': 5.0,\n",
       "  'dusk': 1.0,\n",
       "  'weak': 1.0,\n",
       "  'bushe': 1.0,\n",
       "  'frost': 1.0,\n",
       "  'personal': 1.0,\n",
       "  'one': 2.0,\n",
       "  'high': 1.0,\n",
       "  'wesley': 1.0,\n",
       "  'from': 6.0,\n",
       "  'himself': 1.0,\n",
       "  'brings': 3.0,\n",
       "  'darkness': 1.0,\n",
       "  'his': 4.0,\n",
       "  'like': 1.0,\n",
       "  'well': 3.0,\n",
       "  'norrington': 4.0,\n",
       "  'must': 2.0,\n",
       "  'credibility': 1.0,\n",
       "  'out': 2.0,\n",
       "  'also': 2.0,\n",
       "  'this': 2.0,\n",
       "  'much': 1.0,\n",
       "  'know': 1.0,\n",
       "  'flat': 2.0,\n",
       "  'though': 1.0,\n",
       "  'turned': 1.0,\n",
       "  'funny': 1.0,\n",
       "  'did': 1.0,\n",
       "  'can': 1.0,\n",
       "  'bringing': 1.0,\n",
       "  'has': 3.0,\n",
       "  'heroes': 1.0,\n",
       "  'fact': 3.0,\n",
       "  'br': 10.0,\n",
       "  'dark': 2.0,\n",
       "  'sense': 1.0,\n",
       "  'n': 1.0,\n",
       "  'him': 2.0,\n",
       "  'screen': 1.0,\n",
       "  'works': 2.0,\n",
       "  'which': 7.0,\n",
       "  'vampires': 2.0,\n",
       "  'took': 1.0,\n",
       "  'genius': 1.0,\n",
       "  'dorf': 1.0,\n",
       "  'them': 1.0,\n",
       "  'minor': 1.0,\n",
       "  'reinvented': 1.0,\n",
       "  'tune': 1.0,\n",
       "  'me': 2.0,\n",
       "  'actually': 1.0,\n",
       "  'hero': 1.0,\n",
       "  'used': 1.0,\n",
       "  '8': 1.0,\n",
       "  'best': 3.0,\n",
       "  'because': 1.0,\n",
       "  'seen': 2.0,\n",
       "  'never': 1.0,\n",
       "  'special': 1.0,\n",
       "  'so': 1.0,\n",
       "  'boring': 2.0,\n",
       "  'title': 1.0,\n",
       "  'batman': 1.0,\n",
       "  'outfit': 1.0,\n",
       "  'character': 10.0,\n",
       "  'grudge': 1.0,\n",
       "  'better': 1.0,\n",
       "  'normal': 1.0,\n",
       "  'enough': 1.0,\n",
       "  'martial': 1.0,\n",
       "  'as': 11.0,\n",
       "  'real': 1.0,\n",
       "  'does': 2.0,\n",
       "  'goyer': 1.0,\n",
       "  'facing': 1.0,\n",
       "  'seems': 1.0,\n",
       "  'eventually': 1.0,\n",
       "  'leather': 1.0,\n",
       "  'look': 1.0,\n",
       "  'dracula': 2.0,\n",
       "  'gives': 2.0,\n",
       "  'blue': 1.0,\n",
       "  'previously': 1.0,\n",
       "  'person': 1.0,\n",
       "  'what': 1.0,\n",
       "  'conceived': 1.0,\n",
       "  'originally': 1.0,\n",
       "  'touch': 1.0,\n",
       "  'world': 1.0,\n",
       "  'magical': 1.0,\n",
       "  'german': 1.0,\n",
       "  'who': 2.0,\n",
       "  'seem': 1.0,\n",
       "  'group': 1.0,\n",
       "  'ending': 1.0,\n",
       "  'they': 1.0,\n",
       "  'perhaps': 1.0,\n",
       "  'overall': 1.0,\n",
       "  'ever': 1.0,\n",
       "  'really': 1.0,\n",
       "  'flaws': 1.0,\n",
       "  'par': 1.0,\n",
       "  'however': 2.0,\n",
       "  'on': 2.0,\n",
       "  'done': 2.0,\n",
       "  'arts': 1.0,\n",
       "  'don': 1.0,\n",
       "  'clad': 1.0,\n",
       "  'blade': 6.0,\n",
       "  'renews': 1.0,\n",
       "  'daredevil': 1.0,\n",
       "  'into': 1.0,\n",
       "  'shelved': 1.0,\n",
       "  'that': 11.0,\n",
       "  'case': 1.0,\n",
       "  'are': 2.0,\n",
       "  'marvel': 2.0,\n",
       "  'tense': 1.0,\n",
       "  'stephen': 2.0,\n",
       "  'skilled': 1.0,\n",
       "  'nearly': 1.0,\n",
       "  'credit': 1.0,\n",
       "  'making': 1.0,\n",
       "  'whistler': 1.0,\n",
       "  'it': 3.0,\n",
       "  'people': 1.0,\n",
       "  'with': 9.0,\n",
       "  'not': 1.0,\n",
       "  'take': 1.0,\n",
       "  'is': 15.0,\n",
       "  't': 3.0,\n",
       "  'x': 2.0,\n",
       "  'movie': 4.0,\n",
       "  'superhero': 1.0,\n",
       "  'chased': 1.0,\n",
       "  'of': 25.0,\n",
       "  'deacon': 1.0,\n",
       "  'effects': 2.0,\n",
       "  'born': 1.0,\n",
       "  'kier': 1.0,\n",
       "  'rigid': 1.0,\n",
       "  'snipes': 2.0,\n",
       "  'david': 1.0,\n",
       "  'and': 23.0,\n",
       "  'was': 4.0,\n",
       "  'mentioned': 1.0,\n",
       "  'adds': 2.0,\n",
       "  'least': 1.0,\n",
       "  'style': 6.0,\n",
       "  'all': 5.0,\n",
       "  '10': 1.0,\n",
       "  'near': 1.0,\n",
       "  'at': 1.0,\n",
       "  'to': 11.0,\n",
       "  'comic': 2.0,\n",
       "  'in': 16.0,\n",
       "  'lot': 7.0,\n",
       "  'have': 4.0,\n",
       "  'were': 2.0},\n",
       " 'predictions': 1.0}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movies.sort('predictions', ascending=False)[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'review': \"Even duller, if possible, than the original (I hope I may say that under the IMDb guidelines). THE FRENCH CONNECTION at least tried to absorb European influences, to complicate the conventional view of the American police detective, even if the attempt was foundered by Friedkin's ambivalence, Americaness and general indirection. The (relative) arthouse boom of the 1960s (especially with the nouvelle vague) allowed for a huge influence of European cinema in Hollywood. This lent a new vigour and complexity to a weary medium, and, in the best of them (eg BONNIE AND CLYDE, early Scorcese), a new subversion of received practice. The original CONNECTION was part of this movement, with its difficultly distanced style, and anti-detective figure. TWO is old Hollywood's right-wing reassertion of American values.<br /><br />This is figured in the film's very tiresome America vs France dialectic. For instance, TWO is shot like a 70s French policier. It was the French, of course, who insisted on the greatness of American movies when they were ignored at home, and this, in a sense, is a reclamation, a warning against Gallic presumption. This can be seen in the pattern of the two movies. CONNECTION has French gangsters invading New York, with the French style smothering the American thriller - this leads to the dissolution of the detective figure, and irresolution of plot - the baddie got away. <br /><br />TWO has the American returning to France, with American thriller values imposed on the native genre - the power of the detective is reasserted and conventional resolution is achieved. This is further dramatised in Doyle's relationship with French inspector Barthelmy, whose dominant influence he must shake off before he can control the plot.<br /><br />TWO seems to follow the original by undermining its detective hero. From the start, Doyle's importance is diminished at every turn. Despite the ending of CONNECTION, he is considered a hero. But he is an American in a foreign land, and his inability to control language or customs means he cannot dominate the plot. He even misreads the signs of the police force, mistaking an informer for a criminal, and getting him killed. <br /><br />A detective's power comes from his power as subject to see and interpret, but Doyle spends much of the movie being watched, controlled, an object, a body (literally in the scenes after he is dumped by Charnier) to be viewed and interpreted. In CONNECTION, he instigated the action, chasing the criminals, forcing the plot; here he is passive, tied to a bed, locked in a cell, an addict, a dependent.<br /><br />This loss of phallic power is predictably symbolised in the loss of his gun, and the film follows a depressingly familiar Oedipal trajectory. In the heroin sequences, he is comforted by an old lady who says he looks like her son. His drugged state is like a return to the womb, robbed of adult pressures. Her taking his watch reinforces the timelessness of this state, doubly significant for a man whose career depends on timetables and precision.<br /><br />Oedipus was the first detective, and to avoid his fate, Doyle must reject this false mother who is dissolving his unified identity, and kill the father (Charnier) so that he can take his accepted masculine role in society. Psychoanalytic theory was popular among academics in the 70s(ironically instigated by a Frenchman, Jacques Lacan), but it's rare to see a film so literally full of it. <br /><br />If all of these facts tended towards the minimising of Doyle, then the film's style doesn't. Friedkin distanced us from his hero by refusing empathy or character motivation, focusing on the mechanics of plot. Here, Doyle is a very conventional Hollywood hero. Instead of being lost in murky long shot, he is made knowable and understandable to the viewer with the traditional devices - point-of-view shots, close ups, connecting shots etc.<br /><br />TWO is all about the fall and rise of Popeye Doyle. Plot in this case is subservient to the acting, which is the usual Hackman showiness. The cold turkey scenes, therefore, despite their tediousness, are not disturbing. We are allowed to share rather than coldly observe; this a far less discomforting experience. The scenes are also shot through with a lachrymose manly sentimentality that is very American. <br /><br />So while CONNECTION tried to imitate the complex thrillers of Jean Pierre Melville, TWO does the complete opposite. Melville's LE SAMOURAI featured a gangster who started the film whole, powerful, outside language, and charted his eventual disintegration. TWO starts with a disintegrated character, achieved partly through inability with language, whose dominance begins when he steps outside language - the concluding action sequences are largely wordless. <br /><br />In the film, the locale and language are important as they fixed and undermined the detective, but as he regains his power (figured in the return of his gun, and the cathartic burning of the primal site of vulnerability, the tower block where Charnier held him), the Marseilles setting becomes more irrelevant, and the mythic stand-off, which could take place anywhere, takes over. Compare the endings of the two films: one admits ambiguity and despair, the other absolute certainty.<br /><br />\",\n",
       " 'sentiment': 'negative',\n",
       " 'words': {'other': 1.0,\n",
       "  'films': 1.0,\n",
       "  'compare': 1.0,\n",
       "  'over': 1.0,\n",
       "  'certainty': 1.0,\n",
       "  'takes': 1.0,\n",
       "  'place': 1.0,\n",
       "  'irrelevant': 1.0,\n",
       "  'more': 1.0,\n",
       "  'marseilles': 1.0,\n",
       "  'held': 1.0,\n",
       "  'block': 1.0,\n",
       "  'vulnerability': 1.0,\n",
       "  'primal': 1.0,\n",
       "  'weary': 1.0,\n",
       "  'locale': 1.0,\n",
       "  'stand': 1.0,\n",
       "  'largely': 1.0,\n",
       "  'inspector': 1.0,\n",
       "  'steps': 1.0,\n",
       "  'control': 2.0,\n",
       "  'partly': 1.0,\n",
       "  'americaness': 1.0,\n",
       "  'disintegrated': 1.0,\n",
       "  'reclamation': 1.0,\n",
       "  'started': 1.0,\n",
       "  'eventual': 1.0,\n",
       "  'charted': 1.0,\n",
       "  'whole': 1.0,\n",
       "  'familiar': 1.0,\n",
       "  'gangster': 1.0,\n",
       "  'robbed': 1.0,\n",
       "  'are': 5.0,\n",
       "  'samourai': 1.0,\n",
       "  'le': 1.0,\n",
       "  'melville': 2.0,\n",
       "  'has': 2.0,\n",
       "  'pierre': 1.0,\n",
       "  'jean': 1.0,\n",
       "  'complex': 1.0,\n",
       "  'sentimentality': 1.0,\n",
       "  'manly': 1.0,\n",
       "  'wordless': 1.0,\n",
       "  'imitate': 1.0,\n",
       "  'discomforting': 1.0,\n",
       "  'less': 1.0,\n",
       "  'observe': 1.0,\n",
       "  'share': 1.0,\n",
       "  'dumped': 1.0,\n",
       "  'disintegration': 1.0,\n",
       "  'does': 1.0,\n",
       "  'hero': 4.0,\n",
       "  'disturbing': 1.0,\n",
       "  'which': 2.0,\n",
       "  'concluding': 1.0,\n",
       "  'cold': 1.0,\n",
       "  'acting': 1.0,\n",
       "  'rise': 1.0,\n",
       "  'fall': 1.0,\n",
       "  'interpret': 1.0,\n",
       "  'about': 1.0,\n",
       "  'etc': 1.0,\n",
       "  'i': 2.0,\n",
       "  'empathy': 1.0,\n",
       "  'close': 1.0,\n",
       "  'traditional': 1.0,\n",
       "  'motivation': 1.0,\n",
       "  'burning': 1.0,\n",
       "  't': 1.0,\n",
       "  'tended': 1.0,\n",
       "  'undermined': 1.0,\n",
       "  'sense': 1.0,\n",
       "  'subject': 1.0,\n",
       "  'these': 1.0,\n",
       "  'his': 12.0,\n",
       "  'devices': 1.0,\n",
       "  'full': 1.0,\n",
       "  'rare': 1.0,\n",
       "  'lacan': 1.0,\n",
       "  'reassertion': 1.0,\n",
       "  'jacques': 1.0,\n",
       "  'theory': 1.0,\n",
       "  'drugged': 1.0,\n",
       "  'psychoanalytic': 1.0,\n",
       "  'taking': 1.0,\n",
       "  'society': 1.0,\n",
       "  'popeye': 1.0,\n",
       "  'oedipal': 1.0,\n",
       "  'starts': 1.0,\n",
       "  'regains': 1.0,\n",
       "  'masculine': 1.0,\n",
       "  'accepted': 1.0,\n",
       "  'interpreted': 1.0,\n",
       "  'not': 1.0,\n",
       "  'take': 2.0,\n",
       "  'so': 3.0,\n",
       "  'father': 1.0,\n",
       "  'police': 2.0,\n",
       "  'kill': 1.0,\n",
       "  'minimising': 1.0,\n",
       "  'identity': 1.0,\n",
       "  'unified': 1.0,\n",
       "  'opposite': 1.0,\n",
       "  'dissolving': 1.0,\n",
       "  'mother': 1.0,\n",
       "  'false': 1.0,\n",
       "  'academics': 1.0,\n",
       "  'reject': 1.0,\n",
       "  'part': 1.0,\n",
       "  'fate': 1.0,\n",
       "  'avoid': 1.0,\n",
       "  'first': 1.0,\n",
       "  'precision': 1.0,\n",
       "  'off': 2.0,\n",
       "  'timetables': 1.0,\n",
       "  'complete': 1.0,\n",
       "  'career': 1.0,\n",
       "  'body': 1.0,\n",
       "  'significant': 1.0,\n",
       "  'long': 1.0,\n",
       "  'popular': 1.0,\n",
       "  'doubly': 1.0,\n",
       "  'timelessness': 1.0,\n",
       "  'admits': 1.0,\n",
       "  'watch': 1.0,\n",
       "  'pressures': 1.0,\n",
       "  'pattern': 1.0,\n",
       "  'shake': 1.0,\n",
       "  'therefore': 1.0,\n",
       "  'adult': 1.0,\n",
       "  'womb': 1.0,\n",
       "  'vague': 1.0,\n",
       "  'return': 2.0,\n",
       "  'like': 3.0,\n",
       "  'outside': 2.0,\n",
       "  'leads': 1.0,\n",
       "  'son': 1.0,\n",
       "  'her': 2.0,\n",
       "  'focusing': 1.0,\n",
       "  'one': 1.0,\n",
       "  'looks': 1.0,\n",
       "  'experience': 1.0,\n",
       "  'says': 1.0,\n",
       "  'heroin': 1.0,\n",
       "  'trajectory': 1.0,\n",
       "  'case': 1.0,\n",
       "  'movement': 1.0,\n",
       "  'style': 3.0,\n",
       "  'depressingly': 1.0,\n",
       "  'gun': 2.0,\n",
       "  'allowed': 2.0,\n",
       "  'symbolised': 1.0,\n",
       "  'lady': 1.0,\n",
       "  'predictably': 1.0,\n",
       "  'american': 8.0,\n",
       "  'shot': 3.0,\n",
       "  'loss': 2.0,\n",
       "  'criminal': 1.0,\n",
       "  'dependent': 1.0,\n",
       "  'further': 1.0,\n",
       "  'fixed': 1.0,\n",
       "  'connecting': 1.0,\n",
       "  'locked': 1.0,\n",
       "  'frenchman': 1.0,\n",
       "  'ambiguity': 1.0,\n",
       "  'tied': 1.0,\n",
       "  'hope': 1.0,\n",
       "  'here': 2.0,\n",
       "  'forcing': 1.0,\n",
       "  'phallic': 1.0,\n",
       "  'connection': 6.0,\n",
       "  'vigour': 1.0,\n",
       "  'hackman': 1.0,\n",
       "  'lachrymose': 1.0,\n",
       "  'criminals': 1.0,\n",
       "  'instigated': 2.0,\n",
       "  'charnier': 3.0,\n",
       "  'after': 1.0,\n",
       "  'object': 1.0,\n",
       "  'controlled': 1.0,\n",
       "  'scenes': 3.0,\n",
       "  '70s': 2.0,\n",
       "  'watched': 1.0,\n",
       "  'us': 1.0,\n",
       "  'from': 3.0,\n",
       "  'role': 1.0,\n",
       "  'despite': 2.0,\n",
       "  'being': 2.0,\n",
       "  'doesn': 1.0,\n",
       "  'movie': 1.0,\n",
       "  'character': 2.0,\n",
       "  'dominance': 1.0,\n",
       "  'they': 2.0,\n",
       "  'chasing': 1.0,\n",
       "  'force': 1.0,\n",
       "  'much': 1.0,\n",
       "  'could': 1.0,\n",
       "  'murky': 1.0,\n",
       "  'and': 24.0,\n",
       "  'see': 2.0,\n",
       "  'killed': 1.0,\n",
       "  'influence': 2.0,\n",
       "  'customs': 1.0,\n",
       "  'reasserted': 1.0,\n",
       "  'coldly': 1.0,\n",
       "  'or': 2.0,\n",
       "  'as': 3.0,\n",
       "  'them': 1.0,\n",
       "  'language': 5.0,\n",
       "  'tediousness': 1.0,\n",
       "  'inability': 2.0,\n",
       "  'with': 9.0,\n",
       "  'foreign': 1.0,\n",
       "  'values': 2.0,\n",
       "  'were': 1.0,\n",
       "  'dominate': 1.0,\n",
       "  'viewed': 1.0,\n",
       "  'barthelmy': 1.0,\n",
       "  'gangsters': 1.0,\n",
       "  'land': 1.0,\n",
       "  'diminished': 1.0,\n",
       "  'cathartic': 1.0,\n",
       "  'state': 2.0,\n",
       "  'understandable': 1.0,\n",
       "  'every': 1.0,\n",
       "  'their': 1.0,\n",
       "  'cannot': 1.0,\n",
       "  'depends': 1.0,\n",
       "  'undermining': 1.0,\n",
       "  'we': 1.0,\n",
       "  'begins': 1.0,\n",
       "  'smothering': 1.0,\n",
       "  'but': 4.0,\n",
       "  'scorcese': 1.0,\n",
       "  'achieved': 2.0,\n",
       "  'view': 2.0,\n",
       "  'showiness': 1.0,\n",
       "  'seems': 1.0,\n",
       "  'follows': 1.0,\n",
       "  'before': 1.0,\n",
       "  'sequences': 2.0,\n",
       "  'among': 1.0,\n",
       "  'when': 2.0,\n",
       "  'becomes': 1.0,\n",
       "  'he': 15.0,\n",
       "  'is': 22.0,\n",
       "  'whose': 3.0,\n",
       "  'powerful': 1.0,\n",
       "  'relationship': 1.0,\n",
       "  'doyle': 7.0,\n",
       "  'made': 1.0,\n",
       "  'cell': 1.0,\n",
       "  'imposed': 1.0,\n",
       "  'mechanics': 1.0,\n",
       "  'old': 2.0,\n",
       "  'returning': 1.0,\n",
       "  'got': 1.0,\n",
       "  'dissolution': 1.0,\n",
       "  'ending': 1.0,\n",
       "  'by': 6.0,\n",
       "  'thriller': 2.0,\n",
       "  'away': 1.0,\n",
       "  'considered': 1.0,\n",
       "  'the': 71.0,\n",
       "  'ironically': 1.0,\n",
       "  'bed': 1.0,\n",
       "  'plot': 6.0,\n",
       "  'despair': 1.0,\n",
       "  'shots': 2.0,\n",
       "  'tower': 1.0,\n",
       "  'clyde': 1.0,\n",
       "  'turn': 1.0,\n",
       "  'br': 22.0,\n",
       "  'instead': 1.0,\n",
       "  'can': 3.0,\n",
       "  'ups': 1.0,\n",
       "  'resolution': 1.0,\n",
       "  'where': 1.0,\n",
       "  'presumption': 1.0,\n",
       "  'mythic': 1.0,\n",
       "  'rather': 1.0,\n",
       "  'gallic': 1.0,\n",
       "  'against': 1.0,\n",
       "  'him': 2.0,\n",
       "  'site': 1.0,\n",
       "  'turkey': 1.0,\n",
       "  'baddie': 1.0,\n",
       "  'ignored': 1.0,\n",
       "  'france': 2.0,\n",
       "  'viewer': 1.0,\n",
       "  'genre': 1.0,\n",
       "  'greatness': 1.0,\n",
       "  'importance': 1.0,\n",
       "  'on': 4.0,\n",
       "  'endings': 1.0,\n",
       "  'who': 4.0,\n",
       "  'absolute': 1.0,\n",
       "  'nouvelle': 1.0,\n",
       "  'original': 3.0,\n",
       "  'especially': 1.0,\n",
       "  'received': 1.0,\n",
       "  'york': 1.0,\n",
       "  'that': 3.0,\n",
       "  'course': 1.0,\n",
       "  'indirection': 1.0,\n",
       "  'it': 3.0,\n",
       "  'insisted': 1.0,\n",
       "  'policier': 1.0,\n",
       "  'influences': 1.0,\n",
       "  'comes': 1.0,\n",
       "  'follow': 1.0,\n",
       "  'instance': 1.0,\n",
       "  'man': 1.0,\n",
       "  'means': 1.0,\n",
       "  'figured': 2.0,\n",
       "  'important': 1.0,\n",
       "  'mistaking': 1.0,\n",
       "  'attempt': 1.0,\n",
       "  'tiresome': 1.0,\n",
       "  'literally': 2.0,\n",
       "  'medium': 1.0,\n",
       "  'seen': 1.0,\n",
       "  'very': 3.0,\n",
       "  'lost': 1.0,\n",
       "  'movies': 2.0,\n",
       "  'then': 1.0,\n",
       "  'while': 1.0,\n",
       "  'figure': 2.0,\n",
       "  'dramatised': 1.0,\n",
       "  'this': 12.0,\n",
       "  'usual': 1.0,\n",
       "  'its': 2.0,\n",
       "  'wing': 1.0,\n",
       "  'may': 1.0,\n",
       "  'dominant': 1.0,\n",
       "  'anti': 1.0,\n",
       "  'be': 2.0,\n",
       "  'of': 32.0,\n",
       "  'start': 1.0,\n",
       "  'through': 2.0,\n",
       "  'arthouse': 1.0,\n",
       "  'early': 1.0,\n",
       "  'far': 1.0,\n",
       "  'passive': 1.0,\n",
       "  'bonnie': 1.0,\n",
       "  'featured': 1.0,\n",
       "  'vs': 1.0,\n",
       "  'getting': 1.0,\n",
       "  'spends': 1.0,\n",
       "  'eg': 1.0,\n",
       "  'power': 5.0,\n",
       "  'tried': 2.0,\n",
       "  'complexity': 1.0,\n",
       "  'film': 6.0,\n",
       "  'new': 3.0,\n",
       "  'distanced': 2.0,\n",
       "  'lent': 1.0,\n",
       "  'cinema': 1.0,\n",
       "  'an': 5.0,\n",
       "  'conventional': 3.0,\n",
       "  'huge': 1.0,\n",
       "  'reinforces': 1.0,\n",
       "  'america': 1.0,\n",
       "  'warning': 1.0,\n",
       "  'for': 4.0,\n",
       "  'foundered': 1.0,\n",
       "  'irresolution': 1.0,\n",
       "  'knowable': 1.0,\n",
       "  'all': 2.0,\n",
       "  'native': 1.0,\n",
       "  'oedipus': 1.0,\n",
       "  'must': 2.0,\n",
       "  'hollywood': 3.0,\n",
       "  'european': 2.0,\n",
       "  'possible': 1.0,\n",
       "  'informer': 1.0,\n",
       "  'under': 1.0,\n",
       "  'french': 6.0,\n",
       "  'relative': 1.0,\n",
       "  'in': 18.0,\n",
       "  '1960s': 1.0,\n",
       "  'point': 1.0,\n",
       "  'subversion': 1.0,\n",
       "  'thrillers': 1.0,\n",
       "  'if': 3.0,\n",
       "  'to': 17.0,\n",
       "  'general': 1.0,\n",
       "  'say': 1.0,\n",
       "  'ambivalence': 1.0,\n",
       "  'home': 1.0,\n",
       "  'a': 26.0,\n",
       "  'invading': 1.0,\n",
       "  'facts': 1.0,\n",
       "  'addict': 1.0,\n",
       "  's': 9.0,\n",
       "  'at': 3.0,\n",
       "  'than': 2.0,\n",
       "  'misreads': 1.0,\n",
       "  'anywhere': 1.0,\n",
       "  'absorb': 1.0,\n",
       "  'subservient': 1.0,\n",
       "  'setting': 1.0,\n",
       "  'detective': 8.0,\n",
       "  'best': 1.0,\n",
       "  'duller': 1.0,\n",
       "  'towards': 1.0,\n",
       "  'friedkin': 2.0,\n",
       "  'least': 1.0,\n",
       "  'difficultly': 1.0,\n",
       "  'guidelines': 1.0,\n",
       "  'action': 2.0,\n",
       "  'was': 5.0,\n",
       "  'also': 1.0,\n",
       "  'comforted': 1.0,\n",
       "  'imdb': 1.0,\n",
       "  'signs': 1.0,\n",
       "  'complicate': 1.0,\n",
       "  'right': 1.0,\n",
       "  'practice': 1.0,\n",
       "  'dialectic': 1.0,\n",
       "  'refusing': 1.0,\n",
       "  'boom': 1.0,\n",
       "  'two': 9.0,\n",
       "  'even': 3.0},\n",
       " 'predictions': 1.4669526590918097e-97}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movies.sort('predictions', ascending=True)[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
